<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddFieldToNotices extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('notices', function (Blueprint $table) {
            $table->string('title',50)->comment('公告标题');
            $table->text('content')->comment('内容');
            $table->tinyInteger('type')->comment('0全部1平台2经销商3商户4运维');
        });
        Schema::table('notice_managers', function (Blueprint $table) {
            $table->bigInteger('notice_id')->comment('公告ID');
            $table->bigInteger('manager_id')->comment('用户ID');
            $table->tinyInteger('read_state')->default(0)->comment('已读状态0未读1已读');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('notices', function (Blueprint $table) {
            //
        });
    }
}
